<%@page import="com.railway.files.model.*" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>

<html>
<head>  
<head>
	<link type="text/css" rel="stylesheet" href="${ctx}/css/themes/default/easyui.css">
	<link type="text/css" rel="stylesheet" href="${ctx}/css/themes/icon.css">
	<script type="text/javascript" src="${ctx}/scripts/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="${ctx}/scripts/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${ctx}/scripts/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="${ctx}/scripts/jquery-1.4.4.min.js"></script> 
	<script type="text/javascript" src="${ctx}/commons/upload/js/swfobject.js"></script> 
	<script type="text/javascript" src="${ctx}/commons/upload/js/jquery.uploadify.v2.1.4.js"></script> 
	
	<link href="${ctx}/commons/upload/css/uploadify.css" rel="stylesheet" type="text/css" /> 
	
	<script type="text/javascript"> 
	        $(document).ready(function() { 
	            $("#fileupload").uploadify({ 
	                 'allBytesLoaded':300 * 1024*1024,
	                /*注意前面需要书写path的代码*/ 
	                'uploader'       : '${ctx}/commons/upload/js/uploadify.swf', 
	                'script'         : '${ctx}/files/Files/upload.do', 
	                'cancelImg'      : '${ctx}/commons/upload/images/cancel.png', 
	                'queueID'        : 'fileQueue', 
	                'fileDataName'   : 'fileupload', 
	                'auto'           : false,
	                'multi'          : true, 
	                'buttonText'     : '选择文件', 
	                'simUploadLimit' : 5, 
	                'sizeLimit'      : 300* 1024 * 1024, 
	                'queueSizeLimit' : 5, 
	                'fileDesc'       : '支持格式:jpg/gif/jpeg/png/bmp.', 
	                'fileExt'        : '*.zip;*.flv;*.jpg;*.gif;*.jpeg;*.png;*.bmp',
	            onComplete: function (event, queueID, fileObj, response, data) { 
	$('<li></li>').appendTo('.files').text(response); 
	}, 
	onError: function(event, queueID, fileObj) { 
	             alert("文件:" + fileObj.name + "上传失败"); 
	       }, 
	       onCancel: function(event, queueID, fileObj){ 
	             alert("取消了" + fileObj.name); 
	       } 
	            }); 
	
	        }); 
	        </script> 
	
	<script type="text/javascript"> 
	      
	function uploadifyUpload(){ 
	
	   $('#fileupload').uploadifyUpload(); 
	} 
	</script> 
	
	
	<title></title>
</head>
<body>
<table>
	   <tr> 
	<td>上传文件：</td> 
	<td> 
	<input type="file" name="fileupload" id="fileupload" /> 
	
	<div id="fileQueue"></div> 
	<p> 
	<a href="javascript:;" onClick="javascript:uploadifyUpload()">开始上传</a>&nbsp; 
	<a href="javascript:jQuery('#fileupload').uploadifyClearQueue()">取消所有上传</a> 
	</p> 
	<ol class=files></ol> 
	</td> 
 </table>
	
</body>
<script>
//begin $(document).ready(handler)
$(function(){
$('#form1').submit(function(){
	return $('#form1').form('validate');
});}
);//end $(document).ready(handler)
</script>
</html>

